Factor in .gitignore for build cmd freshness
authorAlex Crichton <alex@alexcrichton.com>
Sat, 16 Aug 2014 00:40:08 +0000 (17:40 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 Aug 2014 06:43:27 +0000 (23:43 -0700)
commit8a19eb743741e5ff6a9ef899b632b66070b668b7
tree4fd440483c717c2492c033ce36d1aede414e8686
parent35c1975e8b7a7a18898ddde2f11380e8a3a435de
Factor in .gitignore for build cmd freshness

When testing the freshness of a build command, the fingerprint of an entire
package is generated. The current method of fingerprinting a path source is to
just stat() the entire tree and look at mtimes. This works fine when the build
command places *all* output in the build directory.

Some systems, like autotools, place *most* output in the build directory and
some output in the source directory, however (see spidermonkey). In this case
the coarse-grained "consider all files in a directory as input" is too painful
for the build command as the package will forever be rebuilt.

This commit adds support for filtering the list of files in a directory
considered to be part of a package by using `git ls-files`. This git-specific
logic can be extended to other VCSs when cargo grows support for them.

Closes #379
src/cargo/sources/path.rs
tests/test_cargo_compile_git_deps.rs